using Jupiter.Infrastructure.Responses;
using Wips.AppService.Authorities.Menus.Requests;
using Wips.AppService.Authorities.Menus.Responses;
using Wips.AppService.Authorities.Menus.ViewModels;
using Wips.AppService.CommonViewModels;

namespace Wips.AppService.Authorities.Menus
{
    /// <summary>
    /// 菜单服务接口
    /// </summary>
    public interface IMenuService
    {
        /// <summary>
        /// 读取分页列表
        /// </summary>
        /// <param name="request">请求类</param>
        /// <returns></returns>
        Task<PageResult<GetMenuPagesResponse>> GetPagesAsync(GetMenuPagesRequest request);

        /// <summary>
        /// 读取树形数据
        /// </summary>
        /// <returns></returns>
        Task<List<GetMenuTreeDataResponse>> GetTreeDataAsync();

        /// <summary>
        /// 读取树形选择框数据列表
        /// </summary>
        /// <returns></returns>
        Task<List<TreeSelectViewModel>> GetTreeSelectDataAsync();


        /// <summary>
        /// 获取当前登录人当前应用的菜单
        /// </summary>
        /// <returns></returns>
        Task<List<TreeMenuViewModel>> GetTreeMenuByUserIdAsync();

        /// <summary>
        /// 读取树形选择框数据列表
        /// </summary>
        /// <param name="roleId">角色Id</param>
        /// <param name="applicationId"></param>
        /// <returns></returns>
        Task<GetTreeSelectDataByRoleIdResponse> GetTreeSelectDataByRoleIdAsync(string roleId);

        /// <summary>
        /// 读取信息
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns></returns>
        Task<MenuViewModel> GetByIdAsync(string id);


        /// <summary>
        /// 读取树形选择框数据列表(by 版本和应用)
        /// </summary>
        /// <param name="versionId">版本id </param>
        /// <returns></returns>
        Task<GetTreeSelectDataByRoleIdResponse> GetTreeSelectDataByVersionAsync(
            string versionId);

        /// <summary>
        /// 读取树形表格数据
        /// </summary>
        /// <returns></returns>
        Task<GetTreeTableResponse> GetTreeTableByRoleIdAsync(string roleId);

        /// <summary>
        /// 读取树形表格数据
        /// </summary>
        /// <returns></returns>
        Task<GetTreeTableResponse> GetTreeTableByVersionsIdAsync(string versionId);


        /// <summary>
        /// 读取菜单权限
        /// </summary>
        /// <param name="userId">用户Id，默认为当前登录用户</param>
        /// <param name="versionIds">应用版本</param>
        /// <param name="isRoot">isRoot</param>
        /// <returns></returns>
        Task<List<MenuViewModel>> GetRoutePathAsync(string userId, bool isRoot = false);


        /// <summary>
        /// 获取用户路由
        /// </summary>
        /// <returns></returns>
        Task<List<MenuItemViewModel>> GetUserRoutesAsync();
    }
}